
<seed-content>
  <seed-toolbar-header class="login-title">
     <seed-toolbar-title>登录</seed-toolbar-title>
    <seed-toolbar-menu></seed-toolbar-menu>
  </seed-toolbar-header>

  <!--<div class="logo-login">-->
    <!--<img src="../../assets/images/logo.png" alt="">-->
  <!--</div>-->

<div class="page-login " >
  <div class="login-content">
    <form [formGroup]="loginForm" (submit)="login() ">
      <div class="phone-msg">
        <div *ngIf="loginForm.controls.account.touched && !accountEntrying" >
          <p class="error-msg" *ngIf="invalidPhoneNumber " >{{phoneError}}</p>
        </div>
      </div>
      <div class="login-box login-box-account">
        <div class="login-box-input">
          <input type="tel"
                 formControlName="account"
                 name="login-account"
                 id="login-account"
                 placeholder="手机号/邮箱/账号"
                 (focus)="accountEntrying=true"
                 (blur)="accountEntrying=false"
          >
          <span class="delet-account"
                *ngIf="loginForm.controls['account'].value != ''"
                (click)="loginForm.controls['account'].setValue('')"
          ></span>
        </div>
      </div>
      <div class="psw-msg">
        <div *ngIf="loginForm.controls['loginPwd'].errors && !pswEntrying" >
          <p class="error-msg" >{{pswError}}</p>
        </div>
      </div>
      <input type="password" name="shadowPassword" style="display:none"  autocomplete="off">
      <div class="login-box login-box-password">
        <div class="login-box-input">
          <input type="password"
                 #psw formControlName="loginPwd"
                 name="login-password" id="login-password"
                 placeholder="请输入密码"
                 autocomplete="off"
                 (focus)="pswEntrying=true"
                 (blur)="pswEntrying=false"
          >
          <span class="open-psw" *ngIf="psw.type == 'text'" (click)="psw.type = 'password'"></span>
          <span class="close-psw" *ngIf="psw.type == 'password'" (click)="psw.type = 'text'"></span>
        </div>
      </div>

      <div class=" check-code-box" *ngIf="stateStore.showValidateCode">
        <div class="login-box login-box-input">
          <input type="text"
                 maxlength="4"
                 minlength="4"
                 formControlName="validateCode"
                 placeholder="请输入验证码"
          >
        </div>
        <p>
            <img [src]="dataStore.imgValidateCode" alt="" (click)="getImgValidateCode()">
        </p>
      </div>
      <div class="login-button">
        <button type="submit" [disabled]="!loginForm.valid">登录</button>
      </div>
    </form>
    <div class="login-button register">
      <button [routerLink]="'../register'" >立即注册</button>
    </div>
  </div>

  <div class="third-login-warp " *ngIf="showThirdLogin">
    <h4 class="third-login-title seed-flexbox seed-flexbox-content-center seed-flexbox-align-center">
      <i></i>
      <span>其他登陆方式</span>
      <i></i>
    </h4>
    <div class="third-login-box seed-flexbox seed-flexbox-align-center">
      <i *ngIf="tools.ua().isWeixin"  class="third-login-btn third-wechat" (click)="doWechatLogin()"></i>
      <i class="third-login-btn third-weibo" (click)="doThirdLogin(3)"></i>
      <i class="third-login-btn third-qq" (click)="doThirdLogin(1)"></i>
    </div>
  </div>
</div>
</seed-content>
